{% extends 'template/base.html' %}
{% block head %}
    {{ super() }}
    <title>用户注册</title>
{% endblock %}
{% block body %}
    {% include 'template/user-header.html' %}
    <form action="{{ url_for('register_ep') }}" class="form-horizontal" method="post" id="form_users_register">
        <h1 style="margin-bottom: 50px">用户注册</h1>

        <div class="form-group">
            <label class="col-sm-3 control-label">邮箱</label>
            <div class="col-xs-7">
                <input value="{{ form.data['email'] }}" type="text" class="form-control" name="email"
                       required/>

                <div style="text-align: left;color: red;"> {{ form_errors.email | join('，') }} </div>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">密码</label>
            <div class="col-xs-7">
                <input value="{{ form.data['password'] }}" type="password" class="form-control" name="password"
                       required/>

                <div style="text-align: left;color: red;"> {{ form_errors.password | join('，') }} </div>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">重复密码</label>
            <div class="col-xs-7">
                <input value="{{ form.data['verify_password'] }}" type="password" class="form-control"
                       name="verify_password" required/>

                <div style="text-align: left;color: red;"> {{ form_errors.verify_password | join('，') }} </div>

            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">收货姓名</label>
            <div class="col-xs-7">
                <input value="{{ form.data['realname'] }}" type="text" class="form-control"
                       name="realname" required/>

                <div style="text-align: left;color: red;"> {{ form_errors.realname | join('，') }} </div>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">收货地址</label>
            <div class="col-xs-7">
                <input value="{{ form.data['address'] }}" type="text" class="form-control"
                       name="address"  required/>

                <div style="text-align: left;color: red;"> {{ form_errors.address | join('，') }} </div>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系电话</label>
            <div class="col-xs-7">
                <input value="{{ form.data['tel'] }}" type="text" class="form-control"
                       name="tel" required/>

                <div style="text-align: left;color: red;"> {{ form_errors.tel | join('，') }} </div>

            </div>
        </div>

        {% if errors %}
            <div style="color: red;">{{ messages | join('，') }}</div>
        {% endif %}


        <p class="but">
            <button type="submit" class="btn btn-success">立即注册</button>
        </p>
    </form>
{% endblock %}